package com.wlyuan.open.scanner.utils.enums.quotation;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @description 合约状态
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum TemplateStatusEnum implements NamedValue<Integer> {


    DRAFT(0, 0, "草稿"),
    ISSUE(1, 1, "已发送"),
    AGREE(2, 2, "已审核"),
    REFUSE(3, 3, "拒绝"),
    CLOSED(32, 32, "已关闭"),
    CLOSED_FORBIDDEN(4, 32, "已关闭"),
    //老系统过期审核中 -- 对应新系统 关闭已发送
    EXPIRE_WAIT(99, 4, "关闭已发送"),
    ;

    /**
     * 0 草稿 1 已发布 2 已同意 3已拒绝 4 已关闭 8 议价 32 关闭
     */
    private final Integer value;
    private final Integer newValue;
    private final String name;


    private static final Map<Integer, TemplateStatusEnum> MAP = new NamedValueMap<>(TemplateStatusEnum.class);

    public static TemplateStatusEnum fromValue(Integer value) {
        return MAP.get(value);
    }


}
